<!DOCTYPE doctype PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">

<HTML>
  <HEAD>
    <META name="generator" content=
    "HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net">

    <TITLE>Debugger: Breakpoints in the Listings</TITLE>
    <META http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <LINK rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
  </HEAD>

  <BODY lang="EN-US">
    <H1><A name="plugin"></A>Debugger: Breakpoints in the Listings</H1>

    <DIV class="image">
      <IMG alt="" src="images/DebuggerBreakpointMarkerPlugin.png">
    </DIV>

    <P>For a description of how breakpoints are managed logically in Ghidra, please read about the
    <A href="help/topics/DebuggerBreakpointsPlugin/DebuggerBreakpointsPlugin.html">Breakpoints</A>
    window. Each individual breakpoint location is placed in its respective listing. Breakpoints
    are best controlled using the static program listing, where they are stored as bookmarks. When
    this plugin is active, additional actions are available for managing breakpoints and their
    locations on target. The actions in the static listing manipulate the logical breakpoint as a
    whole; whereas, the actions in the dynamic listing tend to manipulate just the locations for
    the current target. <B>NOTE:</B> Depending on the connected debugger, locations resulting from
    a common specification may not be independently manipulated.</P>

    <P>By default, enabled breakpoints are colored a desaturated blue, ineffective breakpoints are
    colored grey, and disabled breakpoints have no background at all.</P>

    <H2>In the Function Graph</H2>

    <DIV class="image">
      <IMG alt="" src="images/DebuggerFunctionGraphBreakpointMargin.png">
    </DIV>

    <P>When active in the Debugger, the <A href=
    "help/topics/FunctionGraphPlugin/Function_Graph.html">Function Graph</A> will display
    breakpoints using background colors and markers in each vertex's margin. The margin behaves
    exactly as it would in the static listing. A marker is displayed at each address with a
    breakpoint indicating its state. Multiple breakpoints at an address may result in display of a
    mixed state. Double clicking in the margin will set or toggle a breakpoint at that address.</P>

    <H2>In the Decompiler</H2>

    <DIV class="image">
      <IMG alt="" src="images/DebuggerDecompilerBreakpointMargin.png">
    </DIV>

    <P>When active in the Debugger, the <A href=
    "help/topics/DecompilePlugin/DecompilerIntro.html">Decompiler</A> will display breakpoints in
    its margin. Keep in mind, the relationship between machine instructions and the decompiled code
    is not always so simple. One line may correspond to a single address, many addresses, or no
    addresses at all. If there is a breakpoint at any address for a given line, then that line will
    have a marker indicating the breakpoint's state. If there are multiple, then that state may be
    mixed. In most cases, <A href="#set_breakpoint">Setting</A> a breakpoint in the decompiler will
    suggest a Software Execution breakpoint at the minimum address of the current line. If the
    current token is a static variable, then it will suggest a Read/Write breakpoint at the
    variable's address. (Note that Read/Write breakpoints are not indicated in the Decompiler's
    margin.) The other actions affect all breakpoints on the current line.</P>

    <H2>Actions</H2>

    <P>The following actions are added to all disassembly listings by the breakpoint marker plugin.
    They allow the placement and toggling of breakpoints by address, kind, and length. <B>NOTE:</B>
    These actions may also appear in other address-based contexts, but not all of those contexts
    include visual breakpoint indicators. The <A href=
    "help/topics/DebuggerModelPlugin/DebuggerModelPlugin.html">Model</A> pane may provide actions
    to set breakpoints in other ways.</P>

    <H3><A name="toggle_breakpoint"></A><IMG alt="" src="icon.debugger.breakpoint.marker.mixed">
    Toggle Breakpoint (K)</H3>

    <P>This action is always available, and it is suitable for almost all cases. If there is a
    breakpoint at the cursor, this simply toggles its state. If there is no breakpoint at the
    cursor, this will behave like <B>Set Breakpoint</B>, giving a reasonable set of default
    parameters based on the context at the cursor. At an instruction, it will prefer to set a
    Software Execution breakpoint. At defined data, it will prefer to set a Read/Write breakpoint
    of the size of data. At undefined data, or if the target does not support the suggested
    default, the default kind is left unselected. Please use one of the <B>Set Breakpoint</B>
    actions to force specific commands. <B>NOTE:</B> The default parameters are not guaranteed to
    be accepted by the connected debugger.</P>

    <H3><A name="set_breakpoint"></A><IMG alt="" src="icon.debugger.breakpoint.set"> Set
    Breakpoint</H3>

    <P>This menu is available on the dynamic listing when the target supports at least one
    breakpoint kind. This menu is always available on the static listing. It displays set
    breakpoint actions for each reasonable combination of kinds supported by the target. In the
    static listing, all reasonable combinations are available, regardless of target support;
    however, only those kinds supported by the target will be included in the resulting command.
    Selecting one of the actions will display a prompt allowing adjustments to the parameters
    before issuing the command.</P>

    <DIV class="image">
      <IMG alt="" src="images/DebuggerPlaceBreakpointDialog.png">
    </DIV>

    <UL>
      <LI>Address - the address of the breakpoint. It defaults to the address of the instruction or
      data at the cursor.</LI>

      <LI>Length - the length in bytes of the breakpoint. For execution breakpoints, this defaults
      to 1 &mdash; often the required value. For access breakpoints, this defaults to the size of
      the data at the cursor.</LI>

      <LI>Kinds - the kind(s) of breakpoint. Only the reasonable combinations are presented, but
      the user may type any desired combination. A connected debugger may not support the desired
      combination.</LI>

      <LI>Name - the user-defined name of the breakpoint. The name is set on the bookmark at its
      static location, if applicable.</LI>
    </UL>

    <H3><A name="enable_breakpoint"></A><IMG alt="" src="icon.debugger.breakpoint.enable"> Enable
    Breakpoint</H3>

    <P>This action is available when there is at least one disabled breakpoint at the cursor. It
    enables those logical breakpoints.</P>

    <H3><A name="disable_breakpoint"></A><IMG alt="" src="icon.debugger.breakpoint.disable">
    Disable Breakpoint</H3>

    <P>This action is available when there is at least one enabled breakpoint at the cursor. It
    disables those logical breakpoints.</P>

    <H3><A name="clear_breakpoint"></A><IMG alt="" src="icon.debugger.breakpoint.clear"> Clear
    (Delete) Breakpoint</H3>

    <P>This action is available when there is at least one breakpoint (in any state) at the cursor.
    It deletes those logical breakpoints.</P>
  </BODY>
</HTML>
